import java.util.Arrays;

public class Solution167 {
    public int[] twoSum(int[] numbers, int target) {
        int b;
        for (int i = 0; i < numbers.length; i++) {
            if (i > 0 && numbers[i] == numbers[i - 1]) {
                continue;
            }
            b = Arrays.binarySearch(numbers, i + 1, numbers.length, target - numbers[i]);
            if (b > 0) {
                return new int[]{i + 1, b + 1};
            }
        }
        return new int[]{0, 0};
    }
}
